package com.dubito.github.base.activity

import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding

/**
 *@Author: liliang
 *@Date: 2020/8/4 1:10 PM
 *
 */
abstract class BaseDataBindViewModelActivity <DB : ViewDataBinding> : BaseViewModelActivity() {

    lateinit var dataBind: DB

    override fun setContentLayout() {
        dataBind = DataBindingUtil.setContentView(this, getLayoutId())
        dataBind.lifecycleOwner = this
        initViewModelAction()
        initView()
        initData()
    }

    override fun onDestroy() {
        super.onDestroy()
        dataBind.unbind()
    }

}